package com.ruoyi.cms.controller.portal;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.cms.entity.domain.UserMediaFile;
import com.ruoyi.cms.entity.req.UserMediaListReq;
import com.ruoyi.common.core.domain.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.cms.service.UserMediaFileService;

import java.util.List;

/**
 * 用户媒体
 */
@RestController
@RequestMapping("/portal/cms/userMediaFile")
public class UserMediaFileController {

    @Autowired
    private UserMediaFileService userMediaFileService;

    /**
     * 查询用户媒体列表
     */
    @PostMapping("/list")
    public R<Page<UserMediaFile>> list(@RequestBody UserMediaListReq req) {
        return userMediaFileService.list(req);
    }

    /**
     * 批量新增用户媒体
     */
    @PostMapping("/add")
    public R<?> add(@RequestBody List<UserMediaFile> list) {
        return userMediaFileService.add(list);
    }

    /**
     * 批量删除用户媒体
     */
    @PostMapping("/delete")
    public R<?> delete(@RequestParam List<String> ids) {
        return userMediaFileService.delete(ids);
    }

}
